-- GENERATED SPELL FOR [Sunfury Conjurer] --


function spell0_20139(pUnit, Event) --@Bloodcrystal Surge,Self--
pUnit:FullCastSpellOnTarget(35778,pUnit)
pUnit:RegisterEvent('Sorts_20139', 20293, 1)
end

function spell1_20139(pUnit, Event) --@Flamestrike,n/a--
pUnit:FullCastSpellOnTarget(11829,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20139', 11000, 1)
end

function spell2_20139(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(9672,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20139', 7000, 1)
end

function Sorts_20139(pUnit, Event)
local choix_sorts_20139 = math.random(0, 2)
if choix_sorts_20139 == 0 then
pUnit:RegisterEvent('spell0_20139', 1, 1)
end
if choix_sorts_20139 == 1 then
pUnit:RegisterEvent('spell1_20139', 1, 1)
end
if choix_sorts_20139 == 2 then
pUnit:RegisterEvent('spell2_20139', 1, 1)
end
end

function mob20139_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20139', math.random(1500, 3000), 1)
end

function mob20139_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20139_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20139_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20139, 1, 'mob20139_Action')
RegisterUnitEvent(20139, 2, 'mob20139_Leave')
RegisterUnitEvent(20139, 3, 'mob20139_Kill')
RegisterUnitEvent(20139, 4, 'mob20139_Die')
